home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / earcd / biz / dbase / db3_4src.lha / db3.4 / Select.h < prev    next >
C/C++ Source or Header  |  1997-02-15  |  2KB  |  71 lines

  1. /* Public include file for users of the Select "class" */
  2.  
  3. #include <exec/types.h>
  4. #include <exec/nodes.h>
  5. #include <exec/lists.h>
  6. #include <intuition/intuition.h>
  7.  
  8. /* return values from HandleSelIDCMP(Select *). Positive values indicate selection */
  9. #define SEL_PRIVATE -1    /* Nothing important for us (resize, scroll etc) */
  10. #define SEL_CANCEL -2 
  11. #define SEL_SELECT -3    /* Singleclick or keypress */
  12. #define SEL_OK -4            /* Doubleclick or ENTER press */
  13. #define SEL_HELP -5
  14.  
  15.  
  16. /* Needed libraries (automatically opened by SAS C) */
  17. extern struct IntuitionBase *IntuitionBase;
  18. extern struct GfxBase         *GfxBase;
  19. extern struct Library       *GadToolsBase;
  20. extern struct Library         *UtilityBase; /* Strnicmp() */
  21.  
  22. /* Needed global variables. Please set these first */
  23. extern struct Screen        *Scr;
  24. extern APTR                  VisualInfo;
  25.  
  26. /* The SelectWindow "class" */
  27.  
  28. #define COMPLETEBUFSIZ 10
  29. typedef struct {
  30.     struct Window        *SelWnd;
  31.     UWORD                 SelZoom[4];
  32.     struct Gadget        *SelGList;
  33.     struct IntuiMessage   SelMsg;
  34.     struct Gadget        *ListView;
  35.     UWORD                 SelLeft;
  36.     UWORD                 SelTop;
  37.     UWORD                 SelWidth;
  38.     UWORD                 SelHeight;
  39.     UBYTE                *SelCompleteBuf;
  40.     struct MinList        SelList;
  41.     struct Node                *NodeArray;        /* For fixed-size allocations */
  42.     int                         FirstFree;        /* For fixed-size allocations */
  43.     int SelIndex;
  44.     int SelTotal;
  45.     char SelWdt[COMPLETEBUFSIZ+50];
  46.     ULONG StartSecs, StartMicros;
  47. } Select;
  48.  
  49.  
  50. /* Functions you may call */
  51.  
  52. extern Select *NewSelect(void);
  53. extern void DeleteSelect(Select *);
  54. extern int OpenSelect(Select *, struct Window *parentwin, char *wintitle, char *screentitle);
  55. extern int HandleSelectIDCMP(Select *);
  56. extern void CloseSelect(Select *);
  57.  
  58. extern void DisableSelect(Select *s, BOOL flag);
  59. extern void CurrentIndex(Select *s, int index);
  60. extern char *SelectedString(Select *);
  61. void UpdateString(Select *s, int index, char *newstring);
  62. extern char *AddStringFirst(Select *, char *);
  63. extern char *AddStringLast(Select *, char *);
  64. extern char *AddString(Select *, char *, int);
  65. extern char *RemoveFirstString(Select *);
  66. extern char *RemoveLastString(Select *);
  67. extern char *RemoveString(Select *, int);
  68. extern void RemoveAllStrings(Select *);
  69.  
  70. extern BOOL FixSelectSize(Select *s, int n);        /* For speed when handling long lists */
  71.